package com.lovo.util.controller;

import com.lovo.util.vo.ResultVo;
import org.springframework.stereotype.Component;

@Component
public class BaseController {

    public ResultVo success() {
        return new ResultVo(200, "操作成功", null);
    }

    public ResultVo success(String msg) {
        return new ResultVo(200, msg, null);
    }

    public ResultVo success(String msg, Object data) {
        return new ResultVo(200, msg, data);
    }

    public ResultVo fail() {
        return new ResultVo(500, "操作失败", null);
    }

    public ResultVo fail(String msg) {
        return new ResultVo(500, msg, null);
    }

    public ResultVo fail(String msg, Object data) {
        return new ResultVo(500, msg, data);
    }
}
